<?php
$ch = curl_init();
$show_url ="http://api.zuosa.com/users/show.json";
$show_url2 = 'http://api.zuosa.com/users/show.xml?id=falconchen';
$ver_url = 'http://api.zuosa.com/account/verify_credentials.json';
$do_url = 'http://api.zuosa.com/statuses/user_timeline.json?id=falconchen';
$update_url = 'http://api.zuosa.com/statuses/update.json';
$h = array('source'=>'做啥网');

$content = '00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110000111';
$content = str_repeat('测试',140);
var_dump(strlen($content));

//$content = '每次140个文字，中文英文均为一个字符，多了会分多条发送';

$post_data = array(
	'status'=>$content,
	
);

//$post_data = 'status=再次';

curl_setopt($ch, CURLOPT_URL, $update_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch,CURLOPT_USERPWD, 'falconchen:7340985');
curl_setopt($ch, CURLOPT_HTTPHEADER, $h);

curl_setopt($ch, CURLOPT_POST, 1);
//添加变量
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);

#$show_url ="http://api.zuosa.com/users/show.json";

$data = curl_exec($ch);
$data = json_decode($data);
curl_close($ch);

var_dump($data);

